package logger.simple;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.DailyRollingFileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;

/**
 * Configure the root logger
 * @author jan.pumpe
 *
 */
public class MyLogger {
	private static Logger logger = Logger.getRootLogger();
	public static void main(String[] args) {
		System.out.println("sdf");
		try {
		      PatternLayout layout = new PatternLayout( "%d{ISO8601} %-5p [%t] %c: %m%n" );
		      DailyRollingFileAppender fileAppender =
		        new DailyRollingFileAppender( layout, "logs/MeineLogDatei.log", "'.'yyyy-MM-dd_HH-mm" );
		      logger.addAppender( fileAppender );
		      logger.addAppender(new ConsoleAppender(layout));
		      logger.setLevel( Level.ALL );
		      
		    } catch( Exception ex ) {
		      System.out.println( ex );
		    }
		    new MyClass();
	}
}
